# -*- coding:utf-8 -*-
# @Time : 2020/12/11 14:36
# @Author: sl
# @File : start_gunicorn.py

"""
正式环境用gunicorn时启动入口
"""

import multiprocessing
import os

from config.setting_globle import SettingGloble
os.environ['APP_ENV'] = 'prod'  # 正式测试环境切换 test，开发不用切换，在setting_globle中
workers = multiprocessing.cpu_count()
startCmd = "gunicorn -w " + str(workers) + "  -t 50 -D -b  " + SettingGloble.HOST + ":" + str(
    SettingGloble.PORT) + " runserver:app"
#print("start cmd :", startCmd)
#os.system("sh ./bin/stopgunicorn.sh")
os.system(startCmd)
#os.system("while true;do sleep 10;done")

